﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Upeu.Facturacion.Data.Business;
using Upeu.Facturacion.Data.Entities;

namespace Upeu.Facturacion.Data.Test.Business
{
    [TestClass]
    public class ClienteBusinessTest
    {
        [TestMethod]
        public void TestGetListByFilter()
        {
            var lista = ClienteBusiness.GetListByFilter("");
            Assert.IsTrue(lista.Count > 0);
        }
        
        [TestMethod]
        public void TestCreate()
        {
            Cliente nuevo = new Cliente
            {
                Nombre = "Miguel",
                Direccion = "juliaca",
                Ruc = "46464",
                FechaNac = DateTime.Now
            };
            Cliente c = ClienteBusiness.Create(nuevo);
            Assert.IsTrue(c.Id != Guid.Empty );
        }

        [TestMethod]
        public void TestUpdate()
        {
            Cliente nuevo = new Cliente
            {
                Id = new Guid("17f1f0b2-99df-e411-84bc-e069958900b1"),
                Nombre = "Pablo 2",
                Direccion = "puno",
                Ruc = "132131",
                FechaNac = DateTime.Now
            };
            Cliente c = ClienteBusiness.Update(nuevo);
            Assert.IsTrue(c.Id != Guid.Empty);
        }
    }
}
